
set(CODIPACK_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/../include")
set(CODIPACK_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/../cmake")

if(NOT EXISTS "${CODIPACK_INCLUDE_DIR}/codi.hpp")
  set(CODIPACK_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../include")
endif()

file(READ "${CODIPACK_INCLUDE_DIR}/codi.hpp" ver)

string(REGEX MATCH "CODI_MAJOR_VERSION ([0-9]*)" _ ${ver})
set(CODIPACK_MAJOR_VERSION ${CMAKE_MATCH_1})

string(REGEX MATCH "CODI_MINOR_VERSION ([0-9]*)" _ ${ver})
set(CODIPACK_MINOR_VERSION ${CMAKE_MATCH_1})

string(REGEX MATCH "CODI_BUILD_VERSION ([0-9]*)" _ ${ver})
set(CODIPACK_BUILD_VERSION ${CMAKE_MATCH_1})

set(CODIPACK_VERSION "${CODIPACK_MAJOR_VERSION}.${CODIPACK_MINOR_VERSION}.${CODIPACK_BUILD_VERSION}")
set(CODIPACK_NAME "CoDiPack")
set(CODIPACK_CXX_VERSION "cxx_std_11")
